<template>
	<view>
		<view class="pure-top"></view>
		<view class="header">
			<view class="header-item">
				<view class="header-item-num">{{running_water.income||0}}</view>
				<view class="header-item-text">买入</view>
			</view>
			<view class="header-item">
				<view class="header-item-num">{{running_water.expenses||0}}</view>
				<view class="header-item-text">退取</view>
			</view>
		</view>
		<view class="list">
			<navigator open-type="navigate" hover-class="none" :url="'/pages/jewel/user/data_report_bill?type='+item.type+'&name='+item.name" class="list-item" v-for="(item,index) in datalist" :key="index">
				<view class="list-item-info">
					<view class="list-item-info-text"><image class="list-item-info-text-icon" :src="item.icon"></image>{{item.name}}</view>
					<view class="list-item-info-money">{{item.money||0}}</view>
				</view>
				<view class="list-item-deital">明细 >></view>
			</navigator>
		</view>
	</view>
</template>

<script>
	import henglang from '@/common/common.js';
	export default {
		data() {
			return {
				datalist:[],
				running_water:{}
			};
		},
		onLoad() {
			let that = this
			uni.showLoading({
				title:'加载中...'
			})
			henglang.get('stat/fundList', {}, true, function(res){
				uni.hideLoading()
				that.datalist = res.data.data
				that.running_water = res.data.running_water
			})
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #f6f6f6;
		height: 100vh;
	}
	.pure-top {
		width: 100%;
		height: 140rpx;
		position: fixed;
		z-index: 1;
		overflow: hidden;
		&::after {
			content: '';
			width: 100%;
			height: 140rpx;
			position: absolute;
			left: 0;
			top: 0;
			z-index: -1;
			border-radius: 0 0 80% 80%;
			background: #0aac2a;
		}
	}
	.header{
		display: flex;
		align-items: center;
		justify-content: center;
		position: relative;
		z-index: 2;
		&-item{
			flex: 1;
			text-align: center;
			font-size: 32rpx;
			color: #FFFFFF;
			&-num{
				font-size: 44rpx;
			}
		}
	}
	.list{
		position:relative;
		z-index: 1;
		padding-top: 20rpx;
		&-item{
			background-color: #FFFFFF;
			border-radius: 30rpx;
			display: flex;
			justify-content: space-between;
			padding: 0 32rpx 0 40rpx;
			align-items: center;
			height: 145rpx;
			width: 714rpx;
			box-sizing: border-box;
			margin: 0 auto;
			margin-bottom: 20rpx;
			box-shadow: 0px 0px 50rpx rgba(199,199,199, 0.32);
			&-info{
				&-text{
					color: #1f1f1f;
					font-size: 36rpx;
					height: 48rpx;
					display: flex;
					align-items: center;
					&-icon{
						width: 44rpx;
						height: 44rpx;
						margin-right: 14rpx;
						margin-top: 2rpx;
					}
				}
				&-money{
					color: #ec1c1c;
					font-size: 36rpx;
					padding-left: 58rpx;
				}
			}
			&-deital{
				color: #808080;
				font-size: 28rpx;
			}
		}
	}
	
</style>
